package list01.example01;
import list01.example01.service.StudentService;

import java.util.Scanner;

public class StudentManagerDemo03 {//学生管理 案例
        Scanner scanner = new Scanner(System.in);
        StudentService studentService = new StudentService();


        public static void main(String[] args) {
            StudentManagerDemo03 studentManagerDemo03 = new StudentManagerDemo03();
            studentManagerDemo03.init();

        }

        private void init(){
            while (true){
                System.out.println("选择(1、录入;)");
                System.out.println("(0、退出;)");
                int choice = scanner.nextInt();
                if (choice == 1){
                    studentService.add();
                } else if (choice == 0) {
                    studentService.printStudent();
                    scanner.close();
                    break;
                }
            }
        }

    }




